import Vue from 'vue';
import VueRouter from 'vue-router';
import { boardTempRouter } from './boardTemplate.js';
Vue.use(VueRouter);
let routes = [
  {
    path: '/',
    name: '/',
    meta: { title: '首页' },
    component: () => import('../views/home.vue')
  },
  {
    path: '/home',
    name: 'Home',
    meta: { title: '首页' },
    component: () => import('../views/home.vue')
  },
];
routes = routes.concat(boardTempRouter);
const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
});
// router.beforeEach((to,from,next) => {
//   // let loginData = localStorage.getItem('loginData');
//   if(to.path == '/login'){
//     next();
//   }
//   // else if(loginData){
//   //   next();
//   // }else{
//   //   next({ path:'/login' })
//   // }
// });
export default router;
